package com.taikang.pms.entity;

import com.google.common.base.Objects;
import com.taikang.base.BaseEntityBuilder;
import com.taikang.base.entity.BaseBusLongEntity;

import static com.google.common.base.Preconditions.checkNotNull;

public class Community extends BaseBusLongEntity {

    private String name;

    public String getName() {
        return name;
    }

    public static Builder aCommunity() {
        return new Builder();
    }

    public static class Builder{

        private String name;

        public Builder withName(String name) {
            this.name = name;
            return this;
        }

        public Community build() {
            Community community = new Community();
            community.name = checkNotNull(name);
            return community;
        }
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(name, super.getId());
    }


}